#ifndef FRIENDLISTLIB_H
#define FRIENDLISTLIB_H

#include <QObject>
#include <QList>
#include <QPair>
class FriendListLib : public QObject
{
    Q_OBJECT
public:
    static FriendListLib* getInstance();
    FriendListLib(FriendListLib&)=delete;
    QList<QPair<QPair<QString,QString>,QString>> getList();
    QList<QString> getOCList();
    QString getUserOC();
    QString getUserName();
    void setUserName(QString name);
    void setUserOC(QString oc);
    bool isEmpty();
    void updateUser(QString oc,QString name);
    void clearFriendList();
    void removeFriend(const QString& friendoc);
    void setLastestTmp(const QString& oc,const QString& lastest);
    QString getLastestTmp();
signals:
    void s_loadFriendDone();
    void s_userUpdate(QString oc,QString name);
    void s_lastestDone(const QString& oc,const QString& name);
public slots:
    void recvFriendList(const QList<QPair<QPair<QString,QString>,QString>>&);
private:
    static FriendListLib* lib;
    FriendListLib();
    QList<QPair<QPair<QString,QString>,QString>> friendlist;
    //QList<QString> OCList;
    QString useroc,username;
    QString lastesttmp;
};

#endif // FRIENDLISTLIB_H
